/*******************************************************************************
 *                               SGCHIP Center                                 *
 *                            SGCHIP Confidential                              *
 *                       Copyright (c) SGEPRI, 2010-2020                       *
 *                           All Rights Reserved                               *
 *                        http://www.cepri.sgcc.com.cn                         *
 *******************************************************************************/
    
/* Create Date: 2011/03/21
 * 
 * Modify Record:
 *  <date>      <author>       <version>       <desc>
 * -------------------------------------------------------------------
 *  2011/03/21    wenzhen.wang      1.0             Create the file.
 */

/**
 * @file    common.h
 * @ingroup arm
 * @brief   used for every c files
 *
 *  
 *
 * @author  wenzhen.wang( wangwenzhen@sgchip.com )
 * @date    2011/03/21
 * @version 1.0
 */ 

#ifndef COMMON_H
#define COMMON_H

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
#include <termios.h>
#include <pthread.h>

#include <netdb.h>
#include <signal.h>
#include <math.h>
#include <time.h>
#include <stdarg.h>
#include <net/if.h>
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <net/if_arp.h>
#include <arpa/inet.h>
#include <dirent.h>
#include <sys/un.h>


#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#include <sys/socket.h> 
#include <sys/mman.h>
#include <sys/ioctl.h>

#include "typedef.h"

#define PRINTF_ON  					1   
#define PRINTF_OFF 					0   
#define BIG_END    					1


/* Generic exit codes for App dirent, please do not use any of these for CLI return */
#define EXIT_OK             				0
#define EXIT_ERROR        				(-1)
#define TIME_OUT          				(-2)
#define NOT_IMPLEMENTED	  		(-3)
#define PARAMETER_ERROR   			(-4)
#define HARDWARE_ERROR	  		(-5)
#define MEMORY_ERROR	  			(-6)
#define QUEUE_IS_FULL     			(-7)
#define QUEUE_IS_EMPTY    			(-8)


#define THREAD_MAN 					extern

 #define SEND_TIME 100
THREAD_MAN pthread_t tid_uart_send;
THREAD_MAN int uart_send_flags;

 #define REV_TIME 100
THREAD_MAN pthread_t tid_uart_rev;
THREAD_MAN int uart_rev_flags;

 #define PPC_PACKET_TIME 100
THREAD_MAN pthread_t tid_ppc_packet;
THREAD_MAN int ppc_packet_flags;

 #define PPC_RESOLVE_TIME 100
THREAD_MAN pthread_t tid_ppc_resolve;
THREAD_MAN int ppc_resolve_flags;

 #define OPER_HANDLER_TIME 100
THREAD_MAN pthread_t tid_oper_handler;
THREAD_MAN int oper_handler_flags;

 #define ALARM_TIME 100
THREAD_MAN pthread_t tid_alarm;
THREAD_MAN int alarm_flags;

 #define OLT_TIME	100
THREAD_MAN pthread_t tid_olt_cmp;
THREAD_MAN int olt_cmp_flags;

THREAD_MAN pthread_t tid_olt_analy;
THREAD_MAN int olt_analy_flags;

 #define NET_RECV_TIME	100
 #define NET_SEND_TIME	2500
THREAD_MAN pthread_t tid_net_recv1;
THREAD_MAN int net_recv1_flags;

THREAD_MAN pthread_t tid_net_send1;
THREAD_MAN int net_send1_flags;

THREAD_MAN pthread_t tid_net_recv2;
THREAD_MAN int net_recv2_flags;

THREAD_MAN pthread_t tid_net_send2;
THREAD_MAN int net_send2_flags;

#endif      /* end of file.                                                     */
